{extend name="base/index"/}

{block name="page_location"}
<div class="row">
	<div class="col-12">
		<div class="page-title-box">
			<div class="page-title-right">
				<ol class="breadcrumb m-0">
					<li class="breadcrumb-item"><a href="{:url('index/index')}">管理中心</a></li>
					<li class="breadcrumb-item"><i class="iconfont icon-angle-right"></i><a href="">系统工具</a></li>
					<li class="breadcrumb-item active"><i class="iconfont icon-angle-right"></i>无效文件清理</li>
				</ol>
			</div>
			<h4 class="page-title">
				被扫描的字段列表
				<a href="javascript:;" data-toggle="modal" data-target="#new_box" class="btn btn-success btn-sm ml-3">创建新的字段</a>
				<a href="javascript:;" class="btn btn-success btn-sm ml-3" id="fileclear_btn">立即清理无效文件</a>
				<a href="javascript:;" class="btn btn-success btn-sm ml-3" id="clearinvalid_btn">完全删除无效文件</a>
			</h4>
		</div>
	</div>
</div>
{/block}
{block name="body"}
<div class="row" id="manual_list_page">
	<div class="col-12">
		<div class="card">
			<div class="card-body">
				<table class="table table-centered mb-0">
                    <thead>
                        <tr>
                            <th width="5%">ID</th>
                            <th width="10%">扫描数据表</th>
                            <th width="10%">扫描的字段</th>
                            <th width="10%">字段类型</th>
                            <th width="10%">扩展字段</th>
                            <th width="10%">操作</th>
                        </tr>
                    </thead>
                    <tbody>
					{volist name="field_list" id="data"}
					<tr>
						<td>{$data.id}</td>
						<td>{$data.tablename}【{$data.table_comment}】</td>
						<td>{$data.fieldname}【{$data.field_comment}】</td>
						<td>
							{switch name="data.type"}
								{case value="1"}<span class="badge badge-primary">单文件类型</span>{/case}
								{case value="2"}<span class="badge badge-primary">多文件类型</span>{/case}
								{case value="3"}<span class="badge badge-primary">HTML/百度编辑器类型</span>{/case}
								{case value="4"}<span class="badge badge-primary">json类型</span>{/case}
								{case value="5"}<span class="badge badge-primary">序列类型</span>{/case}
								{case value="6"}<span class="badge badge-primary">配置类型</span>{/case}
							{/switch}
						</td>
						<td>{$data.exfield}</td>
						<td>
							 <a href="javascript:;" class="btn btn-danger btn-sm Fast_Del" attr-id="{$data.id}" attr-model="fileclear"><i class="iconfont icon-icon_delete_fill"></i> 删除</a>
						</td>
					</tr>
					{/volist}
                    </tbody>
                </table>
				<div class="row">
					<div class="col-12" style="text-align: center;">
						{$pagelist}
					</div>
				</div>					
			</div>
		</div>
	</div>
</div>
{/block}
{block name="modal_dig"}
<div class="modal fade" id="new_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-full-700">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title dig_title" id="myModalLabel">创建新的字段</h4>
			<button type="button" class="close" data-dismiss="modal">x</button>
          </div>
          <div class="modal-body">
                <form action="#" class="form-horizontal" id="edit_fields_frm">
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">请选择数据表：</label>
                        <div class="col-5">
                            <select class="form-control" tabindex="1" name="table" id="table_select">
                                <option value="">请选择数据表</option>
								{volist name="table_list" id="data"}
								<option value="{$data.TABLE_NAME}">【{$data.TABLE_NAME}】-{$data.ENGINE}-{$data.TABLE_COMMENT}</option>
								{/volist}
                            </select>
                        </div>
                    </div>
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">请选择数据字段：</label>
                        <div class="col-5">
                            <select class="form-control" tabindex="1" name="field"  id="field_select">
                                <option value="0">请选择数据字段</option>
                                
                            </select>
                        </div>
                    </div>       
					<div class="form-group row mb-1">
	                    <label class="col-3 col-form-label">选择类型：</label>
	                    <div class="col-5">
							<div class="custom-control custom-radio">
								<input type="radio" name="type" id="status1" class="custom-control-input" value="1" checked="checked">
								<label class="custom-control-label" for="status1">单文件类型</label>
							</div>
							<div class="custom-control custom-radio">
								<input type="radio" name="type" id="status2" class="custom-control-input" value="2">
								<label class="custom-control-label" for="status2">多文件类型</label>
							</div>
							<div class="custom-control custom-radio">
								<input type="radio" name="type" id="status3" class="custom-control-input" value="3">
								<label class="custom-control-label" for="status3">HTML/百度编辑器类型</label>
							</div>
							<div class="custom-control custom-radio">
								<input type="radio" name="type" id="status4" class="custom-control-input" value="4">
								<label class="custom-control-label" for="status4">json类型</label>
							</div>
							<div class="custom-control custom-radio">
								<input type="radio" name="type" id="status5" class="custom-control-input" value="5">
								<label class="custom-control-label" for="status5">序列类型</label>
							</div>
							<div class="custom-control custom-radio">
								<input type="radio" name="type" id="status6" class="custom-control-input" value="6">
								<label class="custom-control-label" for="status6">配置类型</label>
							</div>	
	                    </div>
	                </div>
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">扩展字段/固定ID：</label>
                        <div class="col-5">
                            <input type="text" name="exfield" placeholder="扩展字段/固定ID" class="form-control" value="">
                            <span class="font-13 text-muted">序列类型/配置类型：必须设置</span>
                        </div>
                    </div>
                </form>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
			<button type="button" class="btn btn-primary Fast_Form_Post" attr-frm="#edit_fields_frm" attr-callback="reload" attr-model="fileclear" attr-active="save_fields">保存</button>
          </div>
        </div>
      </div>
    </div>
{/block}
{block name="script"}
<script type="text/javascript">
$(function(){
});
</script>
{/block}